﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MMessaging.Address
{
	/// <summary>
	/// Beispielimplementation der AddressNotAvailable-Message
	/// </summary>
	public class MAddressNotAvailableMessage : MAddressMessageBase, IMAddressNotAvailableMessage<MAddressMessageBase>
	{
		public MAddressNotAvailableMessage(
			MAddress receiver,
			MAddress sender,
			DateTime sendTime,
			MAddressMessageBase undeliverableMessage
			)
			: base(
			  receiver,
			  sender,
			  sendTime)
		{
			UndeliverableMessage = undeliverableMessage;
		}

		public static MAddressNotAvailableMessage Create(
			MAddressMessageBase undeliverableMessage,
			MAddress receiver,
			MAddress sender,
			DateTime sendTime,
			Guid messageID)
		{
			return new MAddressNotAvailableMessage(
				receiver,
				sender,
				sendTime,
				undeliverableMessage);
		}

		/// <summary>
		/// Unzustellbare Message
		/// </summary>
		public MAddressMessageBase UndeliverableMessage { get; set; }
	}
}
